package com.qf.air.search.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitMQConfig {

    @Bean
    public Exchange airExchange(){
        return ExchangeBuilder.topicExchange("air_exchange").build();
    }

    @Bean
    public Queue airQueue(){
        return QueueBuilder.durable("air_queue").build();
    }

    @Bean
    public Binding airBinding(Queue airQueue,Exchange airExchange){
        return BindingBuilder.bind(airQueue).to(airExchange).with("air.*").noargs();
    }

}
